package com.wing.device.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @version 1.1.0
 * @Author hz
 * @Date 2024-08-19 15:31
 **/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("pro_maintenance")
public class Maintenance extends BaseEntity<Maintenance> implements Serializable {

    private static final long serialVersionUID = 1L;

    //任务类型 1.零时任务 所有手动添加的都是临时任务
    private String taskType;
    //任务类型名字
    @TableField(exist = false)
    private String taskTypeName;
    //任务编号
    private String taskNo;
    //设备id (来自于sku)
    private Long deviceId;
    //设备编号
    @TableField(exist = false)
    private String deviceNo;

    @TableField(exist = false)
    private String deviceName;
    //任务名称
    private String taskName;
    /**
     * 設備model
     */
    private Long deviceModelId;

    @TableField(exist = false)
    private String deviceModelName;
    //状态
    private String status;

    @TableField(exist = false)
    private String statusName;
    //任务性质 来自字典枚举
    private String taskNature;
    //维保类型
    private Long maintenanceType;
    //维保类型名称
    @TableField(exist = false)
    private String maintenanceTypeName;
    //设备点位
    private String deviceLocation;
    //部门id
    private Long departmentId;
    //岗位id
    private Long postId;
    //任务备注
    private String taskRemark;
    //实施前图片
    private String preImg;
    //实施后图片
    private String postImg;
    //审核结果
    private String examineType;
    //审核时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime examineTime;
    //认领记录表id
    private Long claimId;
    //处置记录表id
    private Long handleId;
    //任务id
    @TableField(exist = false)
    private Long taskId;

    /**
     * 性质类型名字
     */
    @TableField(exist = false)
    private String taskNatureName;

    /**
     * 部门名称
     */
    @TableField(exist = false)
    private String departmentName;

    /**
     * 岗位名称
     */
    @TableField(exist = false)
    private String postName;

    /**
     * 认领人
     */
    @TableField(exist = false)
    private String claimName;

    /**
     * 认领时间
     */
    @TableField(exist = false)
    private LocalDateTime claimTime;

}
